<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>首页</title>
    <meta name="Keywords" content="书">
    <link href="/php/x-admin/Public/home/css/public.css" rel="stylesheet" type="text/css">
    <link href="/php/x-admin/Public/home/css/index.css" rel="stylesheet" type="text/css">
    <script src="/php/x-admin/Public/home/js/jquery.js"></script>
</head>
<body id="body" style="overflow-x:hidden">

    <div class="w">
        <div id="topads"></div>

        <!--页头-->
        <!-- 顶部工具栏 -->
<div class="site-nav">
    <div class="wrap">
        <ul class="fl">
            <li>欢迎光临！</li>
        </ul>

        <ul class="fr">

            <li class="mobile">
                <div class="tit"><a href="/php/x-admin/index.php/Home/Index/index">首页</a></div>

            </li>

            <?php if($V=SESSION('username')): ?><li id="_loginname" style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Collect/index">我的收藏</a>
                </li>
                <li style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/User/index">会员中心</a>
                </li>
                <li style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Cart/index/goodsNum/1">去购物车</a>
                </li>
                <li id="_logout" style="">
                    <a href="/php/x-admin/index.php/Home/Login/logout" class="logout">[退出]</a>
                </li>
                <li style="">
                    <a rel="nofollow"><?php echo ($V); ?></a>
                </li>
                <?php else: ?>
                <li id="_register" style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Register/index">[注册]</a>
                </li>
                <li id="_login" style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Login/index">[登录]</a>
                </li><?php endif; ?>
        </ul>
    </div>
</div>
<!------- 头部 ------>
<div class="header clearfix">
    <div class="wrap">
        <div class="logo">
            <a href="/php/x-admin/index.php/Home/Index/index"></a>
        </div>
        <!--搜索 开始-->
        <div class="search" style="position:relative;">
            <div class="search-bar clearfix">
                <form action="/php/x-admin/index.php/Home/Search/index" method="get" onsubmit="return fun()">
                    <input type="text"  id="inputid" name="keyword" class="search-input" value="" placeholder="请输入商品名">
                    <input class="search-btn" type="submit" value="搜索">
                    <script type="text/javascript">
                        function fun(){
                            var inputid=document.getElementById('inputid');
                            ss=inputid.value;
                            if(!ss){
                                return false;
                            }
                        }
                    </script>
                </form>
            </div>


        </div>

    </div>
</div>



        <!--商品分类 开始-->
        <div class="header-nav">
            <div class="wrap">
                <div class="catalogs">
                    <div class="catalogs-title"><a href="javascript:;">全部商品分类▼</a></div>
                    <div class="catalogs-list block" style="display:none">
                        <!-- 遍历顶级分类 -->
                        <?php if(is_array($type)): foreach($type as $key=>$cats): ?><div class="item">
                            <h3 class="t01_channelhome"><a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/<?php echo ($cats["catsid"]); ?>"><i></i><?php echo ($cats["catsname"]); ?><s>&gt;</s></a></h3>
                            <div class="sub-item">
                                <h4><a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/<?php echo ($cats["catsid"]); ?>"><?php echo ($cats["catsname"]); ?></a></h4>
                                <div class="sub-list">
                                    <!--遍历子分类-->
                                    <?php if(is_array($cats['subcat'])): foreach($cats['subcat'] as $key=>$cat): ?><a href="/php/x-admin/index.php/Home/Goodslist/index/soncatsid/<?php echo ($cat["catsid"]); ?>/catsname/<?php echo ($cat["catsname"]); ?>" target="_self"><?php echo ($cat["catsname"]); ?></a><?php endforeach; endif; ?>
                                </div>
                                <div class="catalogs-ad">
                                    <a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/$cats['catsid']"><img style="width:215px;" src="/php/x-admin/Public/home/imgs/yangguang.jpg" alt="$cats['catsname']"></a>
                                </div>
                            </div>
                            </div><?php endforeach; endif; ?>
                        <!-- 分类结束 -->
                    </div>
                </div>
            </div>
        </div>
        <!--商品分类 结束-->

        <!------- 轮播广告 ------>
        <div style="overflow: hidden;position: relative;width: 100%;top: -38px;">
            <ul id="lubo" >
            <?php if(is_array($lubn)): foreach($lubn as $key=>$img): ?><li>
                    <div style="width:100%;overflow:hidden;">
                        <img src="/php/x-admin/Public/Upload/<?php echo ($img["img"]); ?>"  width="100%">
                    </div>
                </li><?php endforeach; endif; ?>
             </ul>
        </div>
        <script>
        $(function(){
            $('#lubo li').eq(0).css('display','block');                //设置第一张图片显示
            $('#lubo li').eq(0).siblings().css('display','none');      //设置除了第一张图片其他的图片都隐藏
            //显示函数
            function show(i){
               $("#lubo li").eq(i).css('display','block');             //第i张图片显示
               $("#lubo li").eq(i).siblings().css('display','none');   //除了第i张图片其他的图片都隐藏

            }
            var lis=$('#lubo li').length; //计算图片总数
            var i=0;
            var init=null;
            //设置定时函数
            function auto(){
                init=setInterval(function(){
                    //调用显示函数，每4000毫秒循环一次
                    show(i);
                    i++;
                    if(i==lis){
                        i=0;
                    }
                },4000);
            }
            //调用定时函数
            auto();
        })
        </script>

        <!-- 商品楼层 -->
        <?php if(is_array($topcats)): foreach($topcats as $key=>$allgoods): ?><div class="floor wrap 01_channelhome clearfix loadfloor loaded" id="t01_channelhome" data-url="/Home/Floor?floorId=01_channelhome">
                <div class="floor-title ">
                    <h2><a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/<?php echo ($allgoods["catsid"]); ?>" target="_self"><?php echo ($allgoods["catsname"]); ?></a></h2>
                </div>

                <div class="floor-con floor-layout2">
                    <div class="floor-side"><a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/<?php echo ($allgoods["catsid"]); ?>" target="_self"><img src="/php/x-admin/Public/home/imgs/floor/<?php echo ($key); ?>.png" width="275"></a></div>
                    <div class="floor-main">
                        <ul>
                            <?php if(is_array($allgoods['goods'])): foreach($allgoods['goods'] as $k=>$good): ?><li><a href="/php/x-admin/index.php/Home/Goodsdetail/index/goodsid/<?php echo ($k); ?>" target="_self"><div class="div1"><span class="span1"></span><img class="img1" src="/php/x-admin/Public/Upload/<?php echo ($good); ?>"></div></a></li><?php endforeach; endif; ?>
                        </ul>
                    </div>
                </div>
            </div><?php endforeach; endif; ?>


        <!--页尾-->
        <!------- 页尾 ------>
<div style="clear:both;"></div>
<div class="footer" style="margin-top: 20px;">
    <div class="wrap" style="margin:0 auto ;">

        <div class="service"><span>联系电话：010-62137141(传真) 62131450 电子邮箱:changchunying@tom.com</span><span>周一至周五 9:00-17:30</span></div>
        <div class="copyright">
            <p>所有图片均受著作权保护，未经许可任何单位与个人不得使用、复制、转载、摘编，违者必究法律责任。</p>
            <p>京ICP备09113557号 北京金企鹅文化发展中心版权所有</p>

        </div>
    </div>
</div>


         <!-- 侧边悬浮  -->
        <div class="sidebar" id="sidebar">
            <a href="" class="s-btn goTop" style="display: none;"></a>
        </div>

    </div>


    <script src="/php/x-admin/Public/home/js/base.js"></script>
</body>
</html>